<?php 
namespace app\index\model;

use think\Model;
use think\Db;

class Member extends Model
{
	//数据库（用户表）
	protected $member = "member";
	protected $type = [
        'status'    =>  'integer',
        'score'     =>  'float',
        'birthday'  =>  'datetime',
        'info'      =>  'array',
    ];

    /**
     * 添加会员
     * @param array $member_info
     */
	public function getMemberInsert($member_info)
	{
		Db::name('member')->insert($member_info);
		$inster_id = Db::name('member')->getLastInsID();
		return $inster_id;
	}

	/**
     * 查找会员
     * @param array $condition
     */
	public function getMemberInfo($condition)
	{
		return Db::name('member')->where($condition)->find();
	}
}
